import request, { ApiResponse } from './request'

// 健康检查响应
export interface HealthCheckData {
  status: 'healthy' | 'unhealthy'
  checks: {
    koa?: boolean
    mysql?: boolean
    redis?: boolean
    [key: string]: boolean | undefined
  }
  timestamp: string
}

// 健康检查
export const checkHealth = (): Promise<ApiResponse<HealthCheckData>> => {
  return request.post<HealthCheckData>('/health/check', {})
}

